package scjp.preparation.chapter123;

import java.util.List;

import scjp.preparation.chapter123.AlcoholicBeverage;


public class GoOutImpl implements GoOut {

	List<AlcoholicBeverage> listOfAlcohol;

	public GoOutImpl(){
		super();
	}
	

	@Override
	public boolean haveFun() {
		boolean isHavingFun = true;
		if (listOfAlcohol.size() > 4)
			isHavingFun = false;
		return isHavingFun;
	}

	/*
	 * Overload
	 */
	public boolean haveFun(DayOfWeek day) {
		boolean isHavingFun = false;
		switch (day) {
		case FRIDAY:
			isHavingFun = true;
			break;
		case SATURDAY:
			isHavingFun = true;
			break;
		default:
			isHavingFun = false;

		}
		return isHavingFun;

	}


	@Override
	public void consumeAlchohol(List<? extends AlcoholicBeverage> alcohol)
			throws DrinkingException {
		if(alcohol.size() > 3) {
			throw new DrinkingException("Too much alcohol is not good for you!");
		}
		
	}

	

}
